<template>
  <div class="team-type">
    <p>NO.1</p>
    <card :header="{title:'一级团队'}" class="card-content">
      <div slot="content" class="card-demo-flex card-demo-content01">
        <div class="vux-1px-l vux-1px-r">
          <img src="../../../static/img/shouyijinbi@2x.png" />
          <br/>
          本月收益 (元)
        </div>
        <div class="vux-1px-r center">
          <div style="padding:.5rem 0rem;">+{{nowteam | fixed}}元</div>
        </div>
        <div class="line"></div>
        <div class="vux-1px-r">
          <img src="../../../static/img/shouyijinbi@2x.png" />
          <br/>
          上月收益 (元)
        </div>
        <div class="center">
          <div style="padding:.5rem 0rem;">+{{teambefore | fixed}}元</div>
        </div>
      </div>
    </card>
</div>
</template>
<script>
import api from '../../api'
import { Card } from 'vux'
import utils from '../../utils'
export default {
  data () {
    return {
      teambefore: null,
      nowteam: null,
      tokenval: ''
    }
  },
  components: {
    Card
  },
  created () {
    var timeStamp = String(Number(new Date()))
    this.tokenval = utils.AuthToken(timeStamp, this.$store.state.userkey)
    var params = {
      Tokenuser: this.tokenval,
      userid: this.$store.state.userID,
      timestamp: timeStamp
    }
    api.bymonth(params).then(res => {
      console.log(res)
      this.teambefore = res.data.list[0].teamIncome
      this.nowteam = res.data.list[1].teamIncome
    })
  }
}
</script>

